package org.hcyspartnoc.luoxin.common.enums.chat;

import lombok.Getter;

@Getter
public enum ChatMessageStatusEnum {
    SENDING(1, "发送中"),
    HAS_SEND(2, "已发送");

    private final Integer code;
    private final String description;

    // 枚举的构造函数，默认是private的
    ChatMessageStatusEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    // 可选：添加一个静态方法，根据code字符串获取对应的枚举实例
    public static ChatMessageStatusEnum fromCode(Integer code) {
        for (ChatMessageStatusEnum type : ChatMessageStatusEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
